package com.kcht.itsed.mws.alespecadapter.biz;

import com.kcht.itsed.mws.alespecadapter.exceptions.TagFieldDecodeException;
import com.kcht.itsed.mws.alespecadapter.facade.ITagDataDecoder;

/**
 * 无符号整形解码器
 * @author 张文硕
 *
 */
public class UintTagDecoder implements ITagDataDecoder{
	
	@Override
	public String decode(String format, String rawHexStr)throws TagFieldDecodeException {
		switch(format){
		case "hex":return rawHexStr;
		case "decimal":return Integer.toString(Integer.parseInt(rawHexStr, 16));
		}
		throw new TagFieldDecodeException("uint类型不存在的格式:"+format);
	}	
}
